package form.ui.css
{
	import form.ui.core.FMSprite;

	public class ButtonCSS extends CSS
	{
		private var _upSkin:String;
		private var _overSkin:String;
		private var _downSkin:String;
		private var _disabledSkin:String;
		
		public function ButtonCSS(owner:FMSprite)
		{
			super(owner);
		}
		
		override public function imitate(css:CSS):CSS
		{
			var n:ButtonCSS = super.imitate(css) as ButtonCSS;
			n._upSkin = _upSkin;
			n._overSkin = _overSkin;
			n._downSkin = _downSkin;
			n._disabledSkin = _disabledSkin;
			return n;
		}
		
		override public function clear():void
		{
			super.clear();
			this._upSkin = null;
			this._overSkin = null;
			this._downSkin = null;
			this._disabledSkin = null;
		}
		
		public function get upSkin():String
		{
			return _upSkin;
		}
		public function set upSkin(value:String):void
		{
			_upSkin = value;
			if(owner.hasRegistedStyle("upSkin")) owner.registerStyle("upSkin", upSkin);
		}
		
		public function get overSkin():String
		{
			return _overSkin;
		}
		public function set overSkin(value:String):void
		{
			_overSkin = value;
			if(owner.hasRegistedStyle("overSkin")) owner.registerStyle("overSkin", overSkin);
		}
		
		public function get downSkin():String
		{
			return _downSkin;
		}
		public function set downSkin(value:String):void
		{
			_downSkin = value;
			if(owner.hasRegistedStyle("downSkin")) owner.registerStyle("downSkin", overSkin);
		}
		
		public function get disabledSkin():String
		{
			return _disabledSkin;
		}
		public function set disabledSkin(value:String):void
		{
			_disabledSkin = value;
			if(owner.hasRegistedStyle("disabledSkin")) owner.registerStyle("disabledSkin", overSkin);
		}
	}
}